home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Information / CSMP Digest / volume 3 / csmp-digest-v3-112 < prev    next >
Text File  |  1995-12-31  |  51KB  |  1,256 lines

  1. C.S.M.P. Digest             Thu, 21 Sep 95       Volume 3 : Issue 112
  2.  
  3. Today's Topics:
  4.  
  5.         Apple Events to open HTML file to specific anchor?
  6.         How to watch a mem location in Macsbug?
  7.         MacTcp and TimeManager
  8.         Patching _Launch (68K)
  9.         Thread Question
  10.         When (and how) to use WRefcon
  11.  
  12.  
  13.  
  14. The Comp.Sys.Mac.Programmer Digest is moderated by Francois Pottier
  15. (pottier@clipper.ens.fr).
  16.  
  17. The digest is a collection of article threads from the internet newsgroups
  18. comp.sys.mac.programmer.help, csmp.tools and csmp.misc. It is designed for
  19. people who read news semi-regularly and want an archive of the discussions.
  20. If you don't know what a newsgroup is, you probably don't have access to
  21. it. Ask your systems administrator(s) for details. If you don't have access
  22. to news, you may still be able to post messages to the group by using a
  23. mail server like anon.penet.fi (mail help@anon.penet.fi for more
  24. information).
  25.  
  26. Each issue of the digest contains one or more sets of articles (called
  27. threads), with each set corresponding to a 'discussion' of a particular
  28. subject.  The articles are not edited; all articles included in this digest
  29. are in their original posted form (as received by our news server at
  30. nef.ens.fr).  Article threads are not added to the digest until the last
  31. article added to the thread is at least two weeks old (this is to ensure that
  32. the thread is dead before adding it to the digest).  Article threads that
  33. consist of only one message are generally not included in the digest.
  34.  
  35. The digest is officially distributed by two means, by email and ftp.
  36.  
  37. If you want to receive the digest by mail, send email to listserv@ens.fr
  38. with no subject and one of the following commands as body:
  39.     help                                Sends you a summary of commands
  40.     subscribe csmp-digest Your Name     Adds you to the mailing list
  41.     signoff csmp-digest                 Removes you from the list
  42. Once you have subscribed, you will automatically receive each new
  43. issue as it is created.
  44.  
  45. The official ftp info is //ftp.dartmouth.edu/pub/csmp-digest.
  46. Questions related to the ftp site should be directed to
  47. scott.silver@dartmouth.edu.
  48.  
  49. -------------------------------------------------------
  50.  
  51. >From reed@medicine.wustl.edu (Thomas Reed)
  52. Subject: Apple Events to open HTML file to specific anchor?
  53. Date: Thu, 31 Aug 1995 15:25:04 -0500
  54. Organization: Washington University
  55.  
  56. I know how to open the HTML file, but I'm wondering if there's a way to
  57. open it to a specific anchor.
  58.  
  59. I know how to do it using HTML Viewer, but the author said that there
  60. isn't a standard.  So, it would appear that I will need to know a method
  61. for each browser -- if there is one.  Yech.
  62.  
  63. Also, does anyone have a list of all the browsers available?
  64.  
  65. Thanks in advance!
  66.  
  67. -Thomas
  68.  
  69. =====================================================
  70. Thomas Reed                     Washington University
  71. reed@visar.wustl.edu               Medical School
  72. reed@medicine.wustl.edu            Saint Louis, MO
  73. http://medinfo.wustl.edu/~reed
  74. - ---------------------------------------------------
  75. Clothes make the man.  Naked people have little or no
  76. influence on society.  -- Mark Twain
  77. =====================================================
  78.  
  79. Opinions posted are not the opinions of Wash. U.
  80.  
  81. +++++++++++++++++++++++++++
  82.  
  83. >From quinn@cs.uwa.edu.au (Quinn "The Eskimo!")
  84. Date: Thu, 07 Sep 1995 11:42:48 +0800
  85. Organization: Underemployed, and loving it!
  86.  
  87. In article <reed-3108951525040001@thomasmac.wustl.edu>,
  88. reed@medicine.wustl.edu (Thomas Reed) wrote:
  89.  
  90. >I know how to open the HTML file, but I'm wondering if there's a way to
  91. >open it to a specific anchor.
  92. >
  93. >I know how to do it using HTML Viewer, but the author said that there
  94. >isn't a standard.  So, it would appear that I will need to know a method
  95. >for each browser -- if there is one.  Yech.
  96.  
  97. Surely you can just do this with the Get URL suite, sending the browser a
  98. "file" URL.  For example, if I command click on this URL...
  99.  
  100. <file:///SuperGrover/Desktop
  101. Folder/Ideology/HumanInterfaceSubtleties.html#PointerObscuring>
  102.  
  103. ... MacWeb loads the file off my local hard disk and scrolls to the
  104. relevant section.
  105.  
  106. The GURL AppleEvent suite is documented in a file available from...
  107.  
  108.    ftp://ftp.acns.nwu.edu/pub/newswatcher/
  109.  
  110. Share and Enjoy.
  111. --
  112. Quinn "The Eskimo!"      "That's it, take me to your secret government
  113.                           labs and cut me into wafer thin sections."
  114.  
  115. ---------------------------
  116.  
  117. >From JZipursky@creo.bc.ca (Jay Zipursky)
  118. Subject: How to watch a mem location in Macsbug?
  119. Date: Tue, 05 Sep 1995 18:09:51 -0800
  120. Organization: Creo Products Inc.
  121.  
  122. Hi folks,
  123.  
  124. I'm grappling with Macsbug once again.  I want my app to break when a
  125. certain memory location is equal to 0.  Can I do this using Macsbug?  If
  126. so, how?
  127.  
  128. Thanks for any help,
  129. Jay
  130.  
  131. -- 
  132. Jay Zipursky                  | jzipursky@creo.bc.ca
  133. Software Engineer             | Voice (604) 451-2700
  134. Creo Products Inc.            | Fax   (604) 437-9891
  135. Burnaby, B.C., Canada         | <Insert Cool Quote Here>
  136.  
  137. +++++++++++++++++++++++++++
  138.  
  139. >From dlyons@netcom.com (David A. Lyons)
  140. Date: Wed, 6 Sep 1995 04:04:48 GMT
  141. Organization: Netcom Online Communications Services (408-241-9760 login: guest)
  142.  
  143. In article <JZipursky-0509951809510001@192.197.216.118> JZipursky@creo.bc.ca (Jay Zipursky) writes:
  144. >Hi folks,
  145. >
  146. >I'm grappling with Macsbug once again.  I want my app to break when a
  147. >certain memory location is equal to 0.  Can I do this using Macsbug?  If
  148. >so, how?
  149.  
  150. Well...you can use a condition on any breakpoint or A-Trap break, so you
  151. can  ATB (123456^.W = 0), which will break on *any* A-Trap when the
  152. condition is true.
  153.  
  154. You can also StepSpy on your location, and you'll break *when the value
  155. changes*, but there's currently no way to wait for it to change to a
  156. particular value (other than manually repeating the SS command each time
  157. you break, looking for the value you want).
  158.  
  159. I hope to get "SS <boolean expression>" into a future MacsBug; it would
  160. step until the expression became true.
  161. -- 
  162. Dave Lyons
  163. Mr Tangent
  164.  
  165.  
  166. +++++++++++++++++++++++++++
  167.  
  168. >From wysocki@netcom.com (Chris Wysocki)
  169. Date: Wed, 6 Sep 1995 07:13:19 GMT
  170. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  171.  
  172. In article <dlyonsDEGu00.n4y@netcom.com>, David A. Lyons
  173. <dlyons@netcom.com> wrote:
  174.  
  175. >You can also StepSpy on your location, and you'll break *when the value
  176. >changes*, but there's currently no way to wait for it to change to a
  177. >particular value (other than manually repeating the SS command each time
  178. >you break, looking for the value you want).
  179. >
  180. >I hope to get "SS <boolean expression>" into a future MacsBug; it would
  181. >step until the expression became true.
  182.  
  183. It would be really cool if MacsBug's Step Spy could be made to work
  184. for PowerPC code; last time I tried it (which was a few MacsBug revs
  185. back), it would only break at the first 68K instruction after the
  186. chunk of PPC code that had stomped on the location being spied upon,
  187. which isn't all that useful.  I can appreciate the difficulties that
  188. could be involved with implementing Step Spy for PPC code, but I
  189. figured I would mention it nonetheless....
  190.  
  191. Chris.
  192.  
  193. ---------------------------
  194.  
  195. >From pangheek@iscs.nus.sg (Hee Kiang)
  196. Subject: MacTcp and TimeManager
  197. Date: 30 Aug 1995 08:14:42 GMT
  198. Organization: National University of Singapore
  199.  
  200. In my application I need to continuosly send data to a remote client using
  201. MacTcp. I wanted to make the sending of data  a periodic time manager task.
  202. But I am worried that it might cause some complications because I don't know
  203. whether MacTcp make any calls directly or indirectly to the memory manager.
  204. And TimeManager Task cannot handle calls to Memory Manager. 
  205.  
  206. Does anybody have any suggestion this ??
  207.  
  208. Hee Kiang
  209.  
  210. +++++++++++++++++++++++++++
  211.  
  212. >From Charles B. Cranston <zben@ni.umd.edu>
  213. Date: 30 Aug 1995 16:42:30 GMT
  214. Organization: Network Infrastructures UMD CSC
  215.  
  216. In article <4216li$668@nuscc.nus.sg> Hee Kiang,
  217. pangheek@iscs.nus.sg writes:
  218.  
  219. > In my application I need to continuosly send data to a remote client using
  220. > MacTcp. I wanted to make the sending of data  a periodic time manager task.
  221. > But I am worried that it might cause some complications because I don't know
  222. > whether MacTcp make any calls directly or indirectly to the memory manager.
  223. > And TimeManager Task cannot handle calls to Memory Manager. 
  224.  
  225. This is a very good question.  As far as I know the current
  226. MacTCP only makes storage allocation calls on the buffers
  227. you pass it for the connection (the buffer is actually made
  228. into a small memory heap using a feature of the Mac heap
  229. manager).  So while there is no problem with the System Heap
  230. or the Application Heap, I might worry about reinterrupting
  231. MacTCP when it is in the middle of doing something with one
  232. of these private heaps.
  233.  
  234. One possibility is to make only asynchronous MacTCP calls.
  235. If MacTCP is busy when such a call is made, the request will
  236. be queued and processed either when MacTCP gets done or at
  237. the next "driver periodic work" call to MacTCP at which time
  238. memory is guaranteed to be valid.
  239.  
  240. Another possibility is to make your own code a Device Driver
  241. and do timed work in response to "driver periodic work" calls.
  242. This would be equivalent to patching "SystemTask" or
  243. "GetNextEvent" in that a badly spinning application can
  244. cause the events to stop happening.  But remember, MacTCP
  245. depends on these periodic work events too, so you're hosed
  246. anyway.
  247.  
  248. So if your code is an application it's probably best to just
  249. time your periodic work on incoming events, since in the normal
  250. case you will get those pretty reliably.
  251.  
  252. You need to take a VERY close look at OpenTransport and its
  253. MacTCP backwards support capabilities, since there seem to
  254. be some things OT doesn't do quite the same in this area...
  255.  
  256. +-+-+
  257. Charles B. (Ben) Cranston <zben@ni.umd.edu>
  258. http://www.wam.umd.edu/~zben
  259.  
  260. +++++++++++++++++++++++++++
  261.  
  262. >From scouten@uiuc.edu (Eric Scouten)
  263. Date: Wed, 30 Aug 1995 12:03:04 -0500
  264. Organization: Huh? What's that?
  265.  
  266. In article <4216li$668@nuscc.nus.sg>, pangheek@iscs.nus.sg (Hee Kiang) wrote:
  267.  
  268. > In my application I need to continuosly send data to a remote client using
  269. > MacTcp. I wanted to make the sending of data  a periodic time manager task.
  270. > But I am worried that it might cause some complications because I don't know
  271. > whether MacTcp make any calls directly or indirectly to the memory manager.
  272. > And TimeManager Task cannot handle calls to Memory Manager.
  273.  
  274. This is fine. I've called MacTCP from inside Time Manager tasks and Sound
  275. Manager callbacks w/o any problems.
  276.  
  277. IMPORTANT WARNING: You *MUST* make the calls to MacTCP asynchronously. If
  278. you spin-wait for the MacTCP calls to complete inside an interrupt-service
  279. routine, no other ISRs can fire (including MacTCP) so the machine *will*
  280. lock up immediately. (It doesn't matter whether you have MacTCP wait by
  281. making the calls synchronously or you call MacTCP asynchronously then
  282. spin-wait until the completion flag is set. Both are unacceptable.)
  283.  
  284. As for memory allocation, MacTCP preallocates all the memory it needs
  285. internally (thus the limitation that you can only have a total of 64
  286. connections open across all applications at any time) or asks you to
  287. preallocate the memory (i.e. stream buffers) before opening the channel.
  288. You'll have to preallocate that buffer before starting the timer task.
  289. Assuming you do your part right, MacTCP will be fine at interrupt level.
  290.  
  291. -es
  292.  
  293. __________________________________________________________________________
  294. Eric Scouten                                       Constructor Constructor
  295. scouten@metrowerks.com                                     Metrowerks, Inc.
  296.  
  297. Don't wake me up 'til my haircut comes back in style.
  298.  
  299. +++++++++++++++++++++++++++
  300.  
  301. >From Richard Wesley <hawkfish@punchdeck.com>
  302. Date: 30 Aug 1995 21:18:30 GMT
  303. Organization: Punch Deck Consulting
  304.  
  305. scouten@uiuc.edu (Eric Scouten) wrote:
  306. >In article <4216li$668@nuscc.nus.sg>, pangheek@iscs.nus.sg (Hee Kiang) wrote:
  307. >
  308. >> In my application I need to continuosly send data to a remote client using
  309. >> MacTcp. I wanted to make the sending of data  a periodic time manager task.
  310. >> But I am worried that it might cause some complications because I don't know
  311. >> whether MacTcp make any calls directly or indirectly to the memory manager.
  312. >> And TimeManager Task cannot handle calls to Memory Manager.
  313. >
  314. >This is fine. I've called MacTCP from inside Time Manager tasks and Sound
  315. >Manager callbacks w/o any problems.
  316. >
  317. >IMPORTANT WARNING: You *MUST* make the calls to MacTCP asynchronously. If
  318. >you spin-wait for the MacTCP calls to complete inside an interrupt-service
  319. >routine, no other ISRs can fire (including MacTCP) so the machine *will*
  320. >lock up immediately. (It doesn't matter whether you have MacTCP wait by
  321. >making the calls synchronously or you call MacTCP asynchronously then
  322. >spin-wait until the completion flag is set. Both are unacceptable.)
  323. >
  324. >As for memory allocation, MacTCP preallocates all the memory it needs
  325. >internally (thus the limitation that you can only have a total of 64
  326. >connections open across all applications at any time) or asks you to
  327. >preallocate the memory (i.e. stream buffers) before opening the channel.
  328. >You'll have to preallocate that buffer before starting the timer task.
  329. >Assuming you do your part right, MacTCP will be fine at interrupt level.
  330.  
  331. In addition to this, I would heartily recommend that you use deferred tasks,
  332. unless you are doing something that is guarenteed to take no time, or
  333. you need precise control over the timing.  Your TMTask can wake up, trigger 
  334. the Deferred Task and then return.
  335.  
  336. - rmgw
  337.  
  338. http://www.punchdeck.com/hawkfish/PunchDeck.html
  339.  
  340. - --------------------------------------------------------------------------
  341. Richard Wesley  hawkfish@punchdeck.com | "'Hand it round first, and cut it
  342. Punch Deck Consulting pnchdeck@aol.com |  afterwards.'" - Lewis Carroll,
  343.      Macintosh Software Development    |    "Through the Looking Glass"
  344. - --------------------------------------------------------------------------
  345.  
  346. +++++++++++++++++++++++++++
  347.  
  348. >From peter@stairways.com.au (Peter N Lewis)
  349. Date: Thu, 07 Sep 1995 17:58:30 +0800
  350. Organization: Stairways Software
  351.  
  352. In article <4216li$668@nuscc.nus.sg>, pangheek@iscs.nus.sg (Hee Kiang) wrote:
  353.  
  354. >In my application I need to continuosly send data to a remote client using
  355. >MacTcp. I wanted to make the sending of data  a periodic time manager task.
  356. >But I am worried that it might cause some complications because I don't know
  357. >whether MacTcp make any calls directly or indirectly to the memory manager.
  358. >And TimeManager Task cannot handle calls to Memory Manager.
  359.  
  360. If you do async calls, then they can be called from interupt time, either
  361. a completion task, a time manager taks, a deferred task or any other
  362. interupt time.
  363.  
  364. I've just written come code that does exactly what you describe above
  365. using MacTCP (over Open Transport) and it works fine for me.
  366.    Peter.
  367. -- 
  368. "there is no significant correlation to violence on TV and agression in 
  369. daily life" - NHR Broadcasting Culture Research Institute in Tokyo.
  370.  
  371. ---------------------------
  372.  
  373. >From mozart@coos.dartmouth.edu (Michael J. Fromberger)
  374. Subject: Patching _Launch (68K)
  375. Date: 1 Sep 1995 21:53:58 GMT
  376. Organization: Dartmouth College, Hanover, NH, USA
  377.  
  378. Hello there,
  379.  
  380. I am attempting to head-patch the _Launch toolbox trap under System
  381. 7.5.1, and I am encountering some difficulties, which I wonder if you
  382. could help me resolve?
  383.  
  384. I have written my patch, which sets up a few parameters, gets the
  385. address of the "unadulterated" _Launch routine, and jumps there.  This
  386. aspect of it works just fine.
  387.  
  388. However, the Finder doesn't seem to want to use my patched version of
  389. _Launch.  In fact, although my patch is used when the Finder is
  390. invoked, the Finder itself seems to bypass my code, so my routine
  391. never gets used.
  392.  
  393. Needless to say, this is somewhat troublesome -- the point of doing
  394. this in the first place is to affect applications which are launched
  395. from the Finder.  Does anyone know what might be happening?  Or,
  396. alternately, can someone direct me to some alternate sources of
  397. information?  I couldn't find anything particularly relevant in the
  398. Tech Notes, although I may not have looked hard enough.
  399.  
  400. Thanks in advance!
  401. -M
  402.  
  403. --
  404. Michael J. Fromberger
  405. Consultant, Postmaster Group, Academic Unix Group
  406. Dartmouth College, Hanover, New Hampshire, USA
  407. Sting@Dartmouth.EDU / mozart@coos.dartmouth.edu
  408.  
  409. "I wish I was on yonder hill,
  410. 'Tis there I'd sit and cry my fill,
  411.  Until every tear would turn a mill..."
  412.  
  413.  
  414. +++++++++++++++++++++++++++
  415.  
  416. >From blob@apple.com (Brian Bechtel)
  417. Date: Sun, 03 Sep 1995 16:43:51 -0700
  418. Organization: Apple Computer, Inc.
  419.  
  420. In article <427vdm$vc@dartvax.dartmouth.edu>, mozart@coos.dartmouth.edu
  421. (Michael J. Fromberger) wrote:
  422.  
  423. > Hello there,
  424. > I am attempting to head-patch the _Launch toolbox trap under System
  425. > 7.5.1, and I am encountering some difficulties, which I wonder if you
  426. > could help me resolve?
  427.  
  428. You can't patch Launch until the Process Manager is up and running.  The
  429. Process Manager replaces the Launch trap with its own, ignoring all
  430. patches.
  431. Patch something likely to be used by the first application starting up
  432. (e.g. InitGraf) and patch Launch at that time.  Remove your patch to
  433. InitGraf while you're at it, so you don't waste other people's time after
  434. your initialization.
  435.  
  436. -- 
  437. --Brian Bechtel    blob@apple.com    Village Idiot, DTS
  438.  
  439. +++++++++++++++++++++++++++
  440.  
  441. >From gurgle@apple.com (Pete Gontier)
  442. Date: Tue, 05 Sep 1995 18:59:57 -0800
  443. Organization: Apple Computer, Inc.
  444.  
  445. In article <blob-0309951643510001@macip9.support.apple.com>,
  446. blob@apple.com (Brian Bechtel) wrote:
  447.  
  448.  > Patch something likely to be used by the first application starting up
  449.  > (e.g. InitGraf) and patch Launch at that time.
  450.  
  451. Some extensions call InitGraf during startup, which means you also need:
  452.  
  453.    if (-1 != *LMGetCurApName ( ))
  454.    {
  455.       // INIT time is over
  456.    }
  457.  
  458. I'm also skeptical whether patching at this time will work. If you patch
  459. when an app has started up, this means the Process Manager is already
  460. managing trap addresses, which means you can only patch one app at a time.
  461. See below for a hint on what to do about this.
  462.  
  463.  > Remove your patch to InitGraf while you're at it, so you don't
  464.  > waste other people's time after your initialization.
  465.  
  466. Even if you succeed in finding a way to patch Launch once for all apps,
  467. this is still tricky because someone else may well have patched InitGraf
  468. on top of you. I favor setting a flag after a patch has run the first
  469. time. It doesn't cost much time to test a flag and get out, especially
  470. since this is InitGraf, which is only called once per app (sort of, as
  471. discussed below).
  472.  
  473. If you leave your InitGraf patch in, you'll be able to patch Launch in
  474. each app's trap table. You'll have to maintain your own table of process
  475. serial numbers so you can avoid patching the same app twice because the
  476. disk initialization package may call InitGraf after the app does (strange
  477. but true!), *and* you'll have to patch ExitToShell so you can tell when a
  478. process is going away so you can take it out of the table.
  479.  
  480. Also, if you leave your patch to InitGraf in, you may well not need to
  481. patch Launch at all, since apps all call InitGraf when they start up. If
  482. you want to manage Launch itself, then you'll still have to patch Launch.
  483.  
  484. Does it sound like I've done this before? Don't answer that. :-)
  485.  
  486. -- 
  487.  Pete Gontier // Software reenignE
  488.  Macintosh Developer Technical Support // Apple Computer, Inc.
  489.  
  490. +++++++++++++++++++++++++++
  491.  
  492. >From skevill@tartarus.uwa.edu.au (Scott Kevill)
  493. Date: Thu, 07 Sep 1995 23:05:22 +0800
  494. Organization: The University of Western Australia
  495.  
  496. In article <blob-0309951643510001@macip9.support.apple.com>,
  497. blob@apple.com (Brian Bechtel) wrote:
  498.  
  499. : In article <427vdm$vc@dartvax.dartmouth.edu>, mozart@coos.dartmouth.edu
  500. : (Michael J. Fromberger) wrote:
  501. : > Hello there,
  502. : > 
  503. : > I am attempting to head-patch the _Launch toolbox trap under System
  504. : > 7.5.1, and I am encountering some difficulties, which I wonder if you
  505. : > could help me resolve?
  506. : You can't patch Launch until the Process Manager is up and running.  The
  507. : Process Manager replaces the Launch trap with its own, ignoring all
  508. : patches.
  509. : Patch something likely to be used by the first application starting up
  510. : (e.g. InitGraf) and patch Launch at that time.  Remove your patch to
  511. : InitGraf while you're at it, so you don't waste other people's time after
  512. : your initialization.
  513. : -- 
  514. : --Brian Bechtel    blob@apple.com    Village Idiot, DTS
  515.  
  516. How do you safely remove your InitGraf patch without affecting any other
  517. InitGraf patches that might have been installed?
  518.  
  519. The only way I could see is to set a flag once you are finished so you can
  520. skip your tests from then on.
  521.  
  522. Scott Kevill
  523. skevill@tartarus.uwa.edu.au
  524.  
  525. ---------------------------
  526.  
  527. >From markwomack@aol.com (MarkWomack)
  528. Subject: Thread Question
  529. Date: 1 Sep 1995 20:01:30 -0400
  530. Organization: America Online, Inc. (1-800-827-6364)
  531.  
  532. I am looking to implement a program using threads, and I have 2 questions:
  533.  
  534. 1) according to the MacTech article I read, preemptive threads are not
  535. allowed on PPC.  Is this still true?
  536.  
  537. 2) Is is possible to pause a thread, save it's state information to a
  538. file, quit the application, restart the application at a later date and
  539. re-invoke the thread with the saved state info, picking up where it left
  540. off??  Sounds Wierd, I know, but the operation I am thinking of doing
  541. might take days to complete.
  542.  
  543. Thanks in advace for any info!
  544. Mark
  545.  
  546. +++++++++++++++++++++++++++
  547.  
  548. >From Scott Thompson <sthompson@macromedia.com>
  549. Date: 5 Sep 1995 13:52:27 GMT
  550. Organization: Macromedia
  551.  
  552. >> 1) according to the MacTech article I read, preemptive threads are
  553. >> not allowed on PPC.  Is this still true?
  554.  
  555. According to the latest information I've seen in the recent releases of 
  556. the Developer CD, the thread manager for PPC still does NOT support 
  557. preemptive threads.  What's more, the documentation does not mention 
  558. preemptive threads for 68k machines although they seem to work (at least 
  559. on my machine).  I think their use is frowned upon by 
  560. "those-who-instill-the-blessings"
  561.  
  562. >> 2) Is is possible to pause a thread, save it's state information to a
  563. >> file, quit the application, restart the application at a later date
  564. >> and re-invoke the thread with the saved state info, picking up where 
  565. >> it left off??  Sounds Wierd, I know, but the operation I am thinking 
  566. >> of doing might take days to complete.
  567.  
  568.  
  569. I would believe that your best bet is to find some way of saving your 
  570. application's progress information and then restoring that information 
  571. and creating a new thread to continue processing.  There are numerous 
  572. problems with saving the thread information itself (i.e. the current 
  573. register status of the CPU, the current location of the Stack pointer, 
  574. etc...) not the least of which is the fact that your executable code may 
  575. be loaded into a different section of memory when you restart the 
  576. application thereby making your PC invalid.
  577.  
  578.  
  579.  
  580. +++++++++++++++++++++++++++
  581.  
  582. >From gurgle@apple.com (Pete Gontier)
  583. Date: Wed, 06 Sep 1995 10:34:57 -0800
  584. Organization: Apple Computer, Inc.
  585.  
  586. In article <42hkmr$oq8@news.macromedia.com>,
  587. Scott Thompson <sthompson@macromedia.com> wrote:
  588.  
  589.  > >> 1) according to the MacTech article I read, preemptive threads are
  590.  > >> not allowed on PPC.  Is this still true?
  591.  > 
  592.  > According to the latest information I've seen in the recent releases of 
  593.  > the Developer CD, the thread manager for PPC still does NOT support 
  594.  > preemptive threads.  What's more, the documentation does not mention 
  595.  > preemptive threads for 68k machines although they seem to work (at least 
  596.  > on my machine).  I think their use is frowned upon by 
  597.  > "those-who-instill-the-blessings"
  598.  
  599. I think the current official line is that the Thread Manager will never
  600. support pre-emptive threads on PPC. For pre-emptive tasks on PPC, you'll
  601. have to wait for Copland. Accordingly, pre-emptive thread support on 68K
  602. has been withdrawn. If it still works, it's only for compatibility; you
  603. shouldn't start a project today that relies on it.
  604.  
  605. I'm just the messenger.
  606.  
  607. -- 
  608.  Pete Gontier // Software reenignE
  609.  Macintosh Developer Technical Support // Apple Computer, Inc.
  610.  
  611. ---------------------------
  612.  
  613. >From schmeul@umich.edu (Sam Huffman)
  614. Subject: When (and how) to use WRefcon
  615. Date: 29 Aug 1995 18:31:56 GMT
  616. Organization: University of Michigan
  617.  
  618. I have a simple application that can have as many as 10 modeless dialog
  619. boxes open at once (all contain the same type of information--it's like
  620. having 10 word processing docs open in wordperfect).
  621.  
  622. Each of these dialog boxes has fields for information which is used in a
  623. calculation. I currently have two arrays that I use to store the data and
  624. dialog boxes, i.e.
  625.  
  626. DialogPtr gDialogList[MAXDIALOGS];
  627. struct dialogGlobalList gDialogGlobals[MAXDIALOGS];
  628.  
  629. So my questions are
  630.  
  631. 1) Is this an appropriate place to use SetWRefCon, and store the
  632. information that would be in gDialogGlobals there?
  633.  
  634. 2) If so, how exactly is this done? Is it as simple as putting the
  635. following code in my CreateDialog procedure?
  636.  
  637. struct dialogGlobalList *gDialogGlobals;
  638. .
  639. . // The Dialog Initialization Code
  640. .
  641. gDialogGlobals = NewPtr(sizeof(struct dialogGlobalList));
  642. SetWRefCon(theDialog, (long) gDialogGlobals);
  643.  
  644. and then I'm done? Or am I missing something?
  645.  
  646. Thanks for any help! This would clean up my code a lot... I would have
  647. tried this except it means a lot of modifications, and if it doesn't work
  648. It would mean a lot of back-peddling.
  649.  
  650. Sam Huffman
  651. schmeul@umich.edu
  652.  
  653. +++++++++++++++++++++++++++
  654.  
  655. >From pandhphot@aol.com (PandH Phot)
  656. Date: 29 Aug 1995 16:47:18 -0400
  657. Organization: America Online, Inc. (1-800-827-6364)
  658.  
  659. Maybe I'm missing something, but couldn't you do away with globals
  660. entirely? How about something like this: create a user-defined structure
  661. which includes all variables which related directly to the information in
  662. a single dialog box; define a pointer type for that structure; use NewPtr
  663. (per your code) to create an instance of that structure; use SetWRefCon to
  664. store that pointer in the window's record.
  665.  
  666. This works pretty well for me: I don't have to decide which array element
  667. belongs to a dialog. When I get a dialog event I just GetWRefCon and I
  668. know right away which data to use (it's the only data I have a pointer
  669. to). No globals: very cool.
  670.  
  671. Good luck!
  672.  
  673. Paul
  674.  
  675. +++++++++++++++++++++++++++
  676.  
  677. >From kurisuto@babel.ling.upenn.edu (Sean Crist)
  678. Date: 30 Aug 1995 02:25:25 GMT
  679. Organization: University of Pennsylvania
  680.  
  681. In article <schmeul-2908951432390001@pscmc3.chemistry.aa.wl.com>,
  682. Sam Huffman <schmeul@umich.edu> wrote:
  683.  
  684. >1) Is this an appropriate place to use SetWRefCon, and store the
  685. >information that would be in gDialogGlobals there?
  686.  
  687. Absolutely.  This is very good programming practice.
  688.  
  689. >2) If so, how exactly is this done? Is it as simple as putting the
  690. >following code in my CreateDialog procedure?
  691. >
  692. >struct dialogGlobalList *gDialogGlobals;
  693. >.
  694. >. // The Dialog Initialization Code
  695. >.
  696. >gDialogGlobals = NewPtr(sizeof(struct dialogGlobalList));
  697. >SetWRefCon(theDialog, (long) gDialogGlobals);
  698. >
  699. >and then I'm done? Or am I missing something?
  700.  
  701. I don't know C, but from what I can make out, that looks fine.  However, I
  702. would recommend that you use a handle rather than a pointer.
  703.  
  704. Actually, once you start doing things this way, you can do away with the
  705. globals for the dialog pointers as well.  I don't keep any global
  706. WindowPtr's or DialogPtr's at all; I identify each window by the data in my
  707. RefCon handle.  If I want a particular window, I just call my SearchWindow
  708. function which steps through the window list and gives me back a WindowPtr
  709. (=DialogPtr) to the window I want.  For all my mousedown, update,
  710. etc. routines, I just do a case (switch) depending on what kind of window
  711. its RefCon data identifies it as.  If you're writing a program which
  712. supports an indefinite number of windows, this is a very practical way to
  713. manage them.
  714.  
  715. Keeping global dialogPtr's can be compared to keeping a leash for each dog;
  716. my way is like having only dog tags, no leashes.  If you have a copy of the
  717. Apprentice CD, look at SeansWindowManager to see how I manage windows this
  718. way (I'll make this code available thru my homepage if there's interest).
  719.  
  720.   \/ __ __    _\_     --Sean Crist  (kurisuto@unagi.cis.upenn.edu)
  721.  ---  |  |    \ /     For a free copy of the Bill of Rights, finger
  722.   _| ,| ,|   -----    this account.  It's also available through
  723.   _| ,| ,|    [_]     my homepage:
  724.    |  |  |    [_]     http://babel.ling.upenn.edu/~kurisuto/homepage.html
  725.  
  726. +++++++++++++++++++++++++++
  727.  
  728. >From brians@pbcomputing.com (Brian Stern)
  729. Date: 30 Aug 1995 04:18:10 GMT
  730. Organization: The University of Texas at Austin, Austin, Texas
  731.  
  732. In article <schmeul-2908951432390001@pscmc3.chemistry.aa.wl.com>,
  733. schmeul@umich.edu (Sam Huffman) wrote:
  734.  
  735. <I have a simple application that can have as many as 10 modeless dialog
  736. <boxes open at once (all contain the same type of information--it's like
  737. <having 10 word processing docs open in wordperfect).
  738. <
  739. <
  740. <So my questions are
  741. <
  742. <1) Is this an appropriate place to use SetWRefCon, and store the
  743. <information that would be in gDialogGlobals there?
  744. <
  745. <2) If so, how exactly is this done? Is it as simple as putting the
  746. <following code in my CreateDialog procedure?
  747. <
  748. <and then I'm done? Or am I missing something?
  749. <
  750. <Thanks for any help! This would clean up my code a lot... I would have
  751. <tried this except it means a lot of modifications, and if it doesn't work
  752. <It would mean a lot of back-peddling.
  753. <
  754. <Sam Huffman
  755. <schmeul@umich.edu
  756.  
  757.  
  758. That's pretty much it.  One additional thing is that it is often helpful
  759. to set the windowkind as well, when the window is created.  Use custom
  760. windowkinds for the different types of windows that your application might
  761. have.  Check the windowkind before doing anything with the pointer or
  762. handle that you've stored in the refcon.  This way you know for sure what
  763. the refcon means before you start dereferencing it.
  764.  
  765. ____________________________________________________________________
  766. Brian  Stern  {:-{)}                          BrianS@pbcomputing.com
  767. Toolbox commando and Menu bard.             Will FlushCache for Cash
  768.  
  769. +++++++++++++++++++++++++++
  770.  
  771. >From schmeul@umich.edu (Sam Huffman)
  772. Date: 30 Aug 1995 13:10:41 GMT
  773. Organization: University of Michigan
  774.  
  775. In article <brians-2908952315170001@slip-15-3.ots.utexas.edu>,
  776. brians@pbcomputing.com (Brian Stern) wrote:
  777.  
  778. > In article <schmeul-2908951432390001@pscmc3.chemistry.aa.wl.com>,
  779. > schmeul@umich.edu (Sam Huffman) wrote:
  780. > <I have a simple application that can have as many as 10 modeless dialog
  781. > <boxes open at once (all contain the same type of information--it's like
  782. > <having 10 word processing docs open in wordperfect).
  783. > <
  784. > <
  785. > <So my questions are
  786. > <
  787. > <1) Is this an appropriate place to use SetWRefCon, and store the
  788. > <information that would be in gDialogGlobals there?
  789. > <
  790. > <2) If so, how exactly is this done? Is it as simple as putting the
  791. > <following code in my CreateDialog procedure?
  792. > <
  793. > <and then I'm done? Or am I missing something?
  794. > <
  795. > <Thanks for any help! This would clean up my code a lot... I would have
  796. > <tried this except it means a lot of modifications, and if it doesn't work
  797. > <It would mean a lot of back-peddling.
  798. > <
  799. > <Sam Huffman
  800. > <schmeul@umich.edu
  801. > That's pretty much it.  One additional thing is that it is often helpful
  802. > to set the windowkind as well, when the window is created.  Use custom
  803. > windowkinds for the different types of windows that your application might
  804. > have.  Check the windowkind before doing anything with the pointer or
  805. > handle that you've stored in the refcon.  This way you know for sure what
  806. > the refcon means before you start dereferencing it.
  807.  
  808. Thanks to everyone for their help! A couple follow-up questions...
  809.  
  810. Can I set the windowKind to an arbitrary value? I.e. do any other Toolbox
  811. calls depend on this being set to a particular value or is it something
  812. that's only there for the programmer's benefit?
  813.  
  814. Do I need to maintain my own window list (through, for example, a "next"
  815. field in my wrefcon structure)? Or is there a system window list that I
  816. can take advantage of?
  817.  
  818. Thanks!
  819.  
  820. Sam Huffman
  821. schmeul@umich.edu
  822.  
  823. +++++++++++++++++++++++++++
  824.  
  825. >From brians@pbcomputing.com (Brian Stern)
  826. Date: 30 Aug 1995 14:31:59 GMT
  827. Organization: The University of Texas at Austin, Austin, Texas
  828.  
  829. In article <schmeul-3008950911250001@pscmc3.chemistry.aa.wl.com>,
  830. schmeul@umich.edu (Sam Huffman) wrote:
  831.  
  832. <In article <brians-2908952315170001@slip-15-3.ots.utexas.edu>,
  833. <brians@pbcomputing.com (Brian Stern) wrote:
  834. <
  835. <> In article <schmeul-2908951432390001@pscmc3.chemistry.aa.wl.com>,
  836. <> schmeul@umich.edu (Sam Huffman) wrote:
  837. <> 
  838. <> <I have a simple application that can have as many as 10 modeless dialog
  839. <> <boxes open at once (all contain the same type of information--it's like
  840. <> <having 10 word processing docs open in wordperfect).
  841. <> <
  842. <> <
  843. <> <So my questions are
  844. <> <
  845. <> <1) Is this an appropriate place to use SetWRefCon, and store the
  846. <> <information that would be in gDialogGlobals there?
  847. <> <
  848. <> <2) If so, how exactly is this done? Is it as simple as putting the
  849. <> <following code in my CreateDialog procedure?
  850. <> <
  851. <> <and then I'm done? Or am I missing something?
  852. <> <
  853. <> <Thanks for any help! This would clean up my code a lot... I would have
  854. <> <tried this except it means a lot of modifications, and if it doesn't work
  855. <> <It would mean a lot of back-peddling.
  856. <> <
  857. <> <Sam Huffman
  858. <> <schmeul@umich.edu
  859. <> 
  860. <> 
  861. <> That's pretty much it.  One additional thing is that it is often helpful
  862. <> to set the windowkind as well, when the window is created.  Use custom
  863. <> windowkinds for the different types of windows that your application might
  864. <> have.  Check the windowkind before doing anything with the pointer or
  865. <> handle that you've stored in the refcon.  This way you know for sure what
  866. <> the refcon means before you start dereferencing it.
  867. <
  868. <Thanks to everyone for their help! A couple follow-up questions...
  869. <
  870. <Can I set the windowKind to an arbitrary value? I.e. do any other Toolbox
  871. <calls depend on this being set to a particular value or is it something
  872. <that's only there for the programmer's benefit?
  873.  
  874. Use windowKinds greater than 8 for your custom document windows.  The
  875. DialogManager uses a value less than that and expects all alerts and
  876. dialogs to have that value.
  877.  
  878. <
  879. <Do I need to maintain my own window list (through, for example, a "next"
  880. <field in my wrefcon structure)? Or is there a system window list that I
  881. <can take advantage of?
  882.  
  883. There is a nextWindow field in each windowRecord.  So the windows in your
  884. app form a linked list.  You can cycle through all the windows in your app
  885. by walking this list starting from FrontWindow().  You might need to keep
  886. your own list if that isn't sufficient for your needs.
  887.  
  888. <
  889. <Thanks!
  890. <
  891. <Sam Huffman
  892. <schmeul@umich.edu
  893.  
  894. ____________________________________________________________________
  895. Brian  Stern  {:-{)}                          BrianS@pbcomputing.com
  896. Toolbox commando and Menu bard.             Will FlushCache for Cash
  897.  
  898. +++++++++++++++++++++++++++
  899.  
  900. >From carl.gustafson@ece.drexel.edu (Carl Gustafson)
  901. Date: 30 Aug 1995 15:36:25 GMT
  902. Organization: Imaging and Computer Vision Center, Drexel University
  903.  
  904. In article <schmeul-3008950911250001@pscmc3.chemistry.aa.wl.com>,
  905. schmeul@umich.edu (Sam Huffman) wrote:
  906.  
  907. > Can I set the windowKind to an arbitrary value? I.e. do any other Toolbox
  908. > calls depend on this being set to a particular value or is it something
  909. > that's only there for the programmer's benefit?
  910.  
  911. Use a positive value. In Days Past, system windows, like DA windows, used
  912. a negative windowkind. (IFIRC)
  913.  
  914.  
  915. > Do I need to maintain my own window list (through, for example, a "next"
  916. > field in my wrefcon structure)? Or is there a system window list that I
  917. > can take advantage of?
  918.  
  919. The nextWindow field in the WindowRecord maintains a link to the next
  920. window down. It gets resorted each time window stacking changes. You can
  921. easily run from FrontWindow () to the backmost in your application (NULL)
  922. by chasing the nextWindow pointers.
  923.  
  924. -- 
  925. Carl Gustafson
  926. Imaging and Computer Vision Center
  927. Drexel University, Philadelphia, Penna
  928. - ----------------------------------------------------------
  929. I don't speak for Drexel, and Drexel doesn't listen to me...
  930.  
  931. +++++++++++++++++++++++++++
  932.  
  933. >From larson@base.cs.ucla.edu (Christopher Larson)
  934. Date: 31 Aug 1995 16:48:58 GMT
  935. Organization: UCLA, Computer Science Department
  936.  
  937. In article <schmeul-3008950911250001@pscmc3.chemistry.aa.wl.com> schmeul@umich.edu (Sam Huffman) writes:
  938. < [ ... ]
  939. >Can I set the windowKind to an arbitrary value? I.e. do any other Toolbox
  940. >calls depend on this being set to a particular value or is it something
  941. >that's only there for the programmer's benefit?
  942.  
  943. Desk accessories and drivers have windowKind values which are negative, so
  944. those are off limits. The Dialog Manager expects all dialog boxes to have
  945. a windowKind of dialogKind (which is 2, I think). Stick with anything
  946. above 8 (which is a constant the name of which escapes me at the moment)
  947. and you should be fine.
  948.  
  949. >Do I need to maintain my own window list (through, for example, a "next"
  950. >field in my wrefcon structure)? Or is there a system window list that I
  951. >can take advantage of?
  952.  
  953. The system keeps track of all the windows in one particluar process, sorted
  954. by Z-order from front to back, in a linked list. You can call FrontWindow()
  955. to get the windowPtr of the frontmost window and then use the nextWindow
  956. field of the WindowRecord to find the window immediately beneath that.
  957. Continue until nextWindow is NULL.
  958.  
  959. --Chris
  960. _______________________________________________________________________________
  961. Chris Larson -- Amateur Macintosh Geek, CoBase Research Assistant
  962. L.A. Institute of Slowly and Painfully Working Out the Surprisingly Obvious
  963. - -------------------------------------+---------------------------------------
  964. (Insert Disclaimer Here)               | Who's the man ridin' in the sun?
  965. UCLA Bruins--1995 NCAA Men's Basketball| Who's the man with the itchy gun?
  966.              National Champions (yea!) | Who's the man who kills for fun?
  967. Internet: larson@kingston.cs.ucla.edu  | Psycho Dad, Psycho Dad, PSYCHO DAD!
  968.  
  969. +++++++++++++++++++++++++++
  970.  
  971. >From neeri@iis.ee.ethz.ch (Matthias Neeracher)
  972. Date: 03 Sep 1995 13:11:11 GMT
  973. Organization: Integrated Systems Laboratory, ETH, Zurich
  974.  
  975. In article <brians-3008950929080001@slip-36-2.ots.utexas.edu>, brians@pbcomputing.com (Brian Stern) writes:
  976. > In article <schmeul-3008950911250001@pscmc3.chemistry.aa.wl.com>,
  977. > schmeul@umich.edu (Sam Huffman) wrote:
  978. > <> <I have a simple application that can have as many as 10 modeless dialog
  979. > <> <boxes open at once (all contain the same type of information--it's like
  980. > <> <having 10 word processing docs open in wordperfect).
  981.  
  982. > <> That's pretty much it.  One additional thing is that it is often helpful
  983. > <> to set the windowkind as well, when the window is created.  Use custom
  984. > <> windowkinds for the different types of windows that your application might
  985. > <> have.  Check the windowkind before doing anything with the pointer or
  986. > <> handle that you've stored in the refcon.  This way you know for sure what
  987. > <> the refcon means before you start dereferencing it.
  988.  
  989. > <Can I set the windowKind to an arbitrary value? I.e. do any other Toolbox
  990. > <calls depend on this being set to a particular value or is it something
  991. > <that's only there for the programmer's benefit?
  992.  
  993. > Use windowKinds greater than 8 for your custom document windows.  The
  994. > DialogManager uses a value less than that and expects all alerts and
  995. > dialogs to have that value.
  996.  
  997. An additional caveat: Sam is using modeless dialogs. At least a few years
  998. ago, it was necessary for the windowKind of windows to be 2 for IsDialogEvent
  999. and/or DialogSelect to succeed. This was especially interesting for windows
  1000. owned by desk accessories (which had to have the drvrRefNum as the window
  1001. kind). Therefore, a tech note demonstrated how to temporarily set the
  1002. windowKind to 2 and then reset it afterwards. Unfortunately, I failed to
  1003. find the technote (it's hard to find documentation about DA's nowadays).
  1004.  
  1005. > <Do I need to maintain my own window list (through, for example, a "next"
  1006. > <field in my wrefcon structure)? Or is there a system window list that I
  1007. > <can take advantage of?
  1008.  
  1009. > There is a nextWindow field in each windowRecord.  So the windows in your
  1010. > app form a linked list.  You can cycle through all the windows in your app
  1011. > by walking this list starting from FrontWindow().  You might need to keep
  1012. > your own list if that isn't sufficient for your needs.
  1013.  
  1014. Another minor comment here: nextWindow links a list of *all* windows - visible
  1015. or not. The head of the list is returned by LMGetWindowList(), while
  1016. FrontWindow() returns the frontmost *visible* window (unless that would be
  1017. LMGetGhostWindow(), but I'm only telling that to show off :-). FrontWindow()
  1018. is almost always what you want, but keep the distinction in mind.
  1019.  
  1020. Matthias
  1021.  
  1022. - ---
  1023. Matthias Neeracher <neeri@iis.ee.ethz.ch> http://err.ethz.ch/members/neeri.html
  1024.    "I'm set free to find a new illusion" -- Velvet Underground
  1025.  
  1026. +++++++++++++++++++++++++++
  1027.  
  1028. >From mhl@icf.hrb.com (Mark H. Linton)
  1029. Date: 4 Sep 95 10:08:45 EST
  1030. Organization: HRB Systems, Inc.
  1031.  
  1032. In article <NEERI.95Sep3151111@yggdrasil.ethz.ch>, neeri@iis.ee.ethz.ch (Matthias Neeracher) writes:
  1033. > In article <brians-3008950929080001@slip-36-2.ots.utexas.edu>, brians@pbcomputing.com (Brian Stern) writes:
  1034. >> In article <schmeul-3008950911250001@pscmc3.chemistry.aa.wl.com>,
  1035. >> schmeul@umich.edu (Sam Huffman) wrote:
  1036. >> <> <I have a simple application that can have as many as 10 modeless dialog
  1037. >> <> <boxes open at once (all contain the same type of information--it's like
  1038. >> <> <having 10 word processing docs open in wordperfect).
  1039. >> There is a nextWindow field in each windowRecord.  So the windows in your
  1040. >> app form a linked list.  You can cycle through all the windows in your app
  1041. >> by walking this list starting from FrontWindow().  You might need to keep
  1042. >> your own list if that isn't sufficient for your needs.
  1043.  
  1044. I presume you are not hoping to make your application work when Copland comes
  1045. out. The new system will gradually phase out WindowPtr's in favor of
  1046. WindowRef's (an opaque data type) in order to allow Apple to redefine thw
  1047. window structure. Try compiling your application with STRICT_WINDOWS defined to
  1048. one. When you get all the compiler errors fixed, you will see that knowledge of
  1049. the WindowRecord structure is no longer helpful.
  1050.  
  1051. To make a long story short... Yes, you have to maintain your own window list.
  1052.  
  1053. To be really helpful. Try keeping a list of your applications documents, each
  1054. item in the list can have one or more windows associated with it. When you get
  1055. a window event, walk your document list and look at each of your document
  1056. windows, if you don't find a match, it must be one of your dialogs. You also no
  1057. longer care about the WindowRecord structure and you are insulated from changes
  1058. Apple may make in the future.
  1059.  
  1060. -- 
  1061. Hope this helps.
  1062.  
  1063. Mark H. Linton
  1064. ____________________________________________________________________
  1065. mark \'märk\ n [ME, fr. OE mearc boundary, march, sign; akin to OHG
  1066. marha boundary, L margo] 1 a : a conspicuous object serving as a guide
  1067. for travelers 2 : A standard or criterion of quality 3 : An object or
  1068. point that serves as a guide --idiom. mark time. 1 : To make little or
  1069. no progress
  1070.  
  1071. +++++++++++++++++++++++++++
  1072.  
  1073. >From kurisuto@babel.ling.upenn.edu (Sean Crist)
  1074. Date: 5 Sep 1995 18:47:12 GMT
  1075. Organization: University of Pennsylvania
  1076.  
  1077. In article <1995Sep4.100845.23655@hrbicf>,
  1078. Mark H. Linton <mhl@icf.hrb.com> wrote:
  1079. >In article <NEERI.95Sep3151111@yggdrasil.ethz.ch>, neeri@iis.ee.ethz.ch (Matthias Neeracher) writes:
  1080.  
  1081. >>> There is a nextWindow field in each windowRecord.  So the windows in your
  1082. >>> app form a linked list.  You can cycle through all the windows in your app
  1083. >>> by walking this list starting from FrontWindow().  You might need to keep
  1084. >>> your own list if that isn't sufficient for your needs.
  1085. >
  1086. >I presume you are not hoping to make your application work when Copland comes
  1087. >out. The new system will gradually phase out WindowPtr's in favor of
  1088. >WindowRef's (an opaque data type) in order to allow Apple to redefine thw
  1089. >window structure. Try compiling your application with STRICT_WINDOWS
  1090. >defined to one. When you get all the compiler errors fixed, you will see
  1091. >that knowledge of the WindowRecord structure is no longer helpful.
  1092. >
  1093. >To make a long story short... Yes, you have to maintain your own window list.
  1094.  
  1095. You've got to be kidding!  I certainly hope there's going to be _some_ way
  1096. to find the next window (visible or not), and to find the frontmost window
  1097. (visible or not) or all my applications are going to break badly; I've
  1098. built everything from the ground up on the assumption that I can do this.
  1099.  
  1100. Is there going to be some kind of function like this?
  1101.  
  1102.    function GetNextWindow(whichWindow: windowPtr) : windowPtr;
  1103.  
  1104. It's fine with me if I can get the next element of the linked list this
  1105. way, rather than by getting the nextWindow out of the structure myself, but
  1106. if there's no way for me to step through the window list, I'm seriously
  1107. screwed.
  1108.  
  1109.   \/ __ __    _\_     --Sean Crist  (kurisuto@unagi.cis.upenn.edu)
  1110.  ---  |  |    \ /     For a free copy of the Bill of Rights, finger
  1111.   _| ,| ,|   -----    this account.  It's also available through
  1112.   _| ,| ,|    [_]     my homepage:
  1113.    |  |  |    [_]     http://babel.ling.upenn.edu/~kurisuto/homepage.html
  1114.  
  1115.  
  1116. +++++++++++++++++++++++++++
  1117.  
  1118. >From mhl@icf.hrb.com (Mark H. Linton)
  1119. Date: 6 Sep 95 10:06:18 EST
  1120. Organization: HRB Systems, Inc.
  1121.  
  1122. In article <42i5vg$lrh@netnews.upenn.edu>, 
  1123.    kurisuto@babel.ling.upenn.edu (Sean Crist) writes:
  1124. > In article <1995Sep4.100845.23655@hrbicf>,
  1125. > Mark H. Linton <mhl@icf.hrb.com> wrote:
  1126. >>
  1127. >>I presume you are not hoping to make your application work when Copland comes
  1128. >>out. The new system will gradually phase out WindowPtr's in favor of
  1129. >>WindowRef's (an opaque data type) in order to allow Apple to redefine thw
  1130. >>window structure. Try compiling your application with STRICT_WINDOWS
  1131. >>defined to one. When you get all the compiler errors fixed, you will see
  1132. >>that knowledge of the WindowRecord structure is no longer helpful.
  1133. >>
  1134. >>To make a long story short... Yes, you have to maintain your own window list.
  1135. > You've got to be kidding!  I certainly hope there's going to be _some_ way
  1136. > to find the next window (visible or not), and to find the frontmost window
  1137. > (visible or not) or all my applications are going to break badly; I've
  1138. > built everything from the ground up on the assumption that I can do this.
  1139. > Is there going to be some kind of function like this?
  1140.  
  1141. Hi Sean... don't freak out on me here... YES, THERE ARE _NOW_ ACCESSOR
  1142. FUNCTIONS FOR ALL OF THE COMPONENTS! I suggest you start using them. Look in
  1143. the header file <Windows.h>. There is quite a diatribe in the comments about
  1144. when/how to make your application work under Copland. There is also an Acrobat
  1145. "paper" on Copland compatibility available on the Apple web sites.
  1146.  
  1147. If that sounds like too much effort and you want to learn it a little at a
  1148. time... do just what I said... #define STRICT_WINDOWS 1 and go through and
  1149. clean up the compiler errors. As you fix each one, you will learn what the new
  1150. accessor function is (they're all macros now).
  1151.  
  1152. >    function GetNextWindow(whichWindow: windowPtr) : windowPtr;
  1153. > It's fine with me if I can get the next element of the linked list this
  1154. > way, rather than by getting the nextWindow out of the structure myself, but
  1155. > if there's no way for me to step through the window list, I'm seriously
  1156. > screwed.
  1157.  
  1158. You're not "seriously screwed" and this is EXACTLY what is being done.
  1159.  
  1160. Spread the word... this is a GoodThing!(tm)
  1161.  
  1162. -- 
  1163. Hope this helps.
  1164.  
  1165. Mark H. Linton
  1166. ____________________________________________________________________
  1167. mark \'märk\ n [ME, fr. OE mearc boundary, march, sign; akin to OHG
  1168. marha boundary, L margo] 1 a : a conspicuous object serving as a guide
  1169. for travelers 2 : A standard or criterion of quality 3 : An object or
  1170. point that serves as a guide --idiom. mark time. 1 : To make little or
  1171. no progress
  1172.  
  1173. +++++++++++++++++++++++++++
  1174.  
  1175. >From awiner@oracle.com (Adam Winer)
  1176. Date: Wed, 06 Sep 1995 21:46:54 -0800
  1177. Organization: Oracle Corporation
  1178.  
  1179. In article <42i5vg$lrh@netnews.upenn.edu>, kurisuto@babel.ling.upenn.edu
  1180. (Sean Crist) wrote:
  1181.  
  1182. > In article <1995Sep4.100845.23655@hrbicf>,
  1183. > Mark H. Linton <mhl@icf.hrb.com> wrote:
  1184. > >In article <NEERI.95Sep3151111@yggdrasil.ethz.ch>, neeri@iis.ee.ethz.ch
  1185. (Matthias Neeracher) writes:
  1186. > >>> There is a nextWindow field in each windowRecord.  So the windows in your
  1187. > >>> app form a linked list.  You can cycle through all the windows in your app
  1188. > >>> by walking this list starting from FrontWindow().  You might need to keep
  1189. > >>> your own list if that isn't sufficient for your needs.
  1190. > >
  1191. > >I presume you are not hoping to make your application work when Copland comes
  1192. > >out. The new system will gradually phase out WindowPtr's in favor of
  1193. > >WindowRef's (an opaque data type) in order to allow Apple to redefine thw
  1194. > >window structure. Try compiling your application with STRICT_WINDOWS
  1195. > >defined to one. When you get all the compiler errors fixed, you will see
  1196. > >that knowledge of the WindowRecord structure is no longer helpful.
  1197. > >
  1198. > >To make a long story short... Yes, you have to maintain your own window list.
  1199. > You've got to be kidding!  I certainly hope there's going to be _some_ way
  1200. > to find the next window (visible or not), and to find the frontmost window
  1201. > (visible or not) or all my applications are going to break badly; I've
  1202. > built everything from the ground up on the assumption that I can do this.
  1203. > Is there going to be some kind of function like this?
  1204. >    function GetNextWindow(whichWindow: windowPtr) : windowPtr;
  1205. > It's fine with me if I can get the next element of the linked list this
  1206. > way, rather than by getting the nextWindow out of the structure myself, but
  1207. > if there's no way for me to step through the window list, I'm seriously
  1208. > screwed.
  1209.  
  1210. Actually, there currently is such a function in Windows.h (well,
  1211. a macro).  However, unlike the other accessor functions, it isn't
  1212. going to be supported in Copland.  The following quote from
  1213. Windows.h should explain this:
  1214.  
  1215. "These accessors will be available as true API entrypoints
  1216. in Copland, but are not guaranteed to match exactly.  Specifically,
  1217. GetNextWindow will not be supported and a whole new model for
  1218. iterating the window list will be presented.  Using GetNextWindow
  1219. for now is ok, however, as it will let you leverage the STRICT flags."
  1220.  
  1221. I would assume their rationale for not supporting GetNextWindow
  1222. has something to do with Copland's built-in support for
  1223. floating windows.  Anyway, I strenuously doubt that an application
  1224. built using GetNextWindow() would break under Copland;  too many
  1225. applications use it.  Of course, if you want to make a Copland-savvy
  1226. app, you'll have to get rid of any such calls, as well as any explicit
  1227. references to the WindowRecord structure.
  1228.  
  1229. -- Adam Winer
  1230. awiner@us.oracle.com
  1231.  
  1232. ---------------------------
  1233.  
  1234. End of C.S.M.P. Digest
  1235. **********************
  1236.